package com.sunny.ynhz.ui.daily.indexproblem;

import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import com.kevin.wraprecyclerview.WrapRecyclerView;
import com.sunny.ynhz.R;
import com.sunny.ynhz.adapter.ProblemWaitForToDoAdapter;
import com.sunny.ynhz.bean.ProblemWaitForAcceptBean;
import com.sunny.ynhz.ui.base.AppBaseTranslationTitleBarActivity;

import java.util.LinkedList;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by luao on 2017/7/14.
 */

public class ProblemWaitForToDoActivity extends AppBaseTranslationTitleBarActivity {
    @BindView(R.id.problem_wait_for_accept_recyclerview)
    RecyclerView problemWaitForAcceptRecyclerview;
    private WrapRecyclerView refreshableView;
    private int pageForRequest;
    LinkedList<ProblemWaitForAcceptBean.DataBean> problemWaitForAcceptList;
    private ProblemWaitForToDoAdapter historyPatrolAdapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_problem_wait_for_accept);
        ButterKnife.bind(this);
        setTitle("待办结");
//        refreshableView = problemWaitForAcceptRecyclerview.getRefreshableView();
//        problemWaitForAcceptRecyclerview.setMode(PullToRefreshBase.Mode.BOTH);
        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
//        refreshableView.setLayoutManager(linearLayoutManager);
        problemWaitForAcceptRecyclerview.setLayoutManager(linearLayoutManager);
        problemWaitForAcceptList = new LinkedList<ProblemWaitForAcceptBean.DataBean>();
        ProblemWaitForAcceptBean.DataBean dataBean = new ProblemWaitForAcceptBean.DataBean();
        //假数据
        problemWaitForAcceptList.add(dataBean);
        problemWaitForAcceptList.add(dataBean);
        problemWaitForAcceptList.add(dataBean);
        problemWaitForAcceptList.add(dataBean);
        problemWaitForAcceptList.add(dataBean);
        problemWaitForAcceptList.add(dataBean);
        problemWaitForAcceptList.add(dataBean);

        historyPatrolAdapter = new ProblemWaitForToDoAdapter(problemWaitForAcceptList,this);
        problemWaitForAcceptRecyclerview.setAdapter(historyPatrolAdapter);


//        problemWaitForAcceptRecyclerview.enable(false);
//        problemWaitForAcceptRecyclerview.setOnRefreshListener(new PullToRefreshBase.OnRefreshListener2<WrapRecyclerView>() {
//            @Override
//            public void onPullDownToRefresh(PullToRefreshBase<WrapRecyclerView> refreshView) {
////                problemWaitForAcceptRecyclerview.onRefreshComplete();
//            }
//
//            @Override
//            public void onPullUpToRefresh(PullToRefreshBase<WrapRecyclerView> refreshView) {
////                getDataWithPage(pageForRequest);
////                problemWaitForAcceptRecyclerview.onRefreshComplete();
//            }
//        });
//
//        //3s延时后，刷新，
//        new Handler().postDelayed(new Runnable() {
//            @Override
//            public void run() {
////                problemWaitForAcceptRecyclerview.setRefreshing();
////                problemWaitForAcceptRecyclerview.onRefreshComplete();
//            }
//        }, 300);

    }

    private void getDataWithPage(int i) {
    }

    public void getData() {
    }
}
